<template>
  <div class="extension-details">

    <div class="main">
      <img src="~@/assets/imgs/extension/success.png" class="img" />
      <p class="status">{{ $t('exSuccess') }}</p>
      <p v-if="overdueFlag === '0'" class="text">Final Repayment Date Of This Extension Order  : <br/>{{ toDate | formatDate('MM-dd-yyyy') }}</p>
      <p v-if="overdueFlag === '1'" class="text">End Date of this order : {{ toDate | formatDate('MM-dd-yyyy') }}</p>
      <div class="list">
        <div class="sort">
          <span>{{ $t('extensionFee') }}</span>
          <span>PHP {{ extensionFee | formatCurrency(',') }}</span>
        </div>
        <div class="sort">
          <span>{{ $t('extensionDays') }}</span>
          <span>{{ extensionDay }} {{ $t('day') }}</span>
        </div>
        <div class="sort">
          <span>{{ $t('extensionDate') }}</span>
          <span>{{ fromDate | formatDate('MM-dd-yyyy') }}～{{ toDate | formatDate('MM-dd-yyyy') }}</span>
        </div>
        <div v-if="extensionPayNumber" class="sort">
          <span>{{ $t('contractNumber') }}</span>
          <span>{{ extensionPayNumber }}</span>
        </div>

      </div>
    </div>

  </div>
</template>

<script>
  export default {
    name: 'extension-details',
    data () {
      return {
        extensionDay: '',
        extensionFee: '',
        fromDate: '',
        toDate: '',
        extensionPayNumber: '',
        overdueFlag: '',
      };
    },
    methods: {
    },
    created () {
      const query = this.$route.query;
      this.extensionDay = query.extensionDay;
      this.extensionFee = query.extensionFee;
      this.fromDate = query.fromDate;
      this.toDate = query.toDate;
      this.extensionPayNumber = query.extensionPayNumber;
      this.overdueFlag = query.overdueFlag;
    }
  };
</script>

<style lang="scss">
  @import "~@/assets/scss/function";

  [data-page=extension-details] {
    .extension-details {
      padding:30px 0;
      .main {
        width:690px;
        background:#FFF;
        border-radius:20px;
        margin:0 auto;
        padding: 80px 28px 20px 28px;
        .img {
          display: block;
          width:166px;
          height:144px;
          margin:0 auto 40px auto;
        }
        .status {
          color: $mainColor;
          font-size:32px;
          font-weight:bold;
          line-height:38px;
          text-align: center;
        }
        .text {
          font-size:28px;
          color:#333333;
          line-height:32px;
          margin: 16px 0 0 0;
          text-align: center;
          font-weight: bold;
        }
        .list {
          margin: 52px 0 0 0;
          .sort {
            font-size:28px;
            color:#777777;
            height:104px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom:1px solid #EEEEEE;
            span:nth-child(2) {
              color:#333333;
              font-weight: bold;
            }
          }
          .sort:last-child {
            border:none;
          }
        }
      }
    }
  }
</style>
